package co.com.smart.persistence.entity.dto;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the smart_agenda database table.
 * 
 */
@Entity
@Table(name="smart_agenda")
@NamedQuery(name="SmartAgenda.findAll", query="SELECT s FROM SmartAgenda s")
public class SmartAgenda implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="sm_scagenda")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private BigDecimal smScagenda;

	@Column(name="sm_coagenda")
	private String smCoagenda;

	@Column(name="sm_cousuario")
	private String smCousuario;

	@Column(name="sm_dsagenda")
	private String smDsagenda;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhagenda")
	private Date smFhagenda;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhhorafinal")
	private Date smFhhorafinal;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhhorainicio")
	private Date smFhhorainicio;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhingreso")
	private Date smFhingreso;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhmodificacion")
	private Date smFhmodificacion;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhretiro")
	private Date smFhretiro;

	@Column(name="sm_scestado")
	private BigDecimal smScestado;

	@Column(name="sm_scsede")
	private BigDecimal smScsede;

	@Column(name="sm_sctiposervicios")
	private BigDecimal smSctiposervicios;

	//bi-directional many-to-one association to SmartConsultorio
	@ManyToOne(optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name="sm_scconsultorio", referencedColumnName = "sm_scconsultorio")
	private SmartConsultorio smartConsultorio;

	//bi-directional many-to-one association to SmartSede
	@ManyToOne(optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name="sm_scsedes",referencedColumnName="sm_scsedes")
	private SmartSede smartSede;

	//bi-directional many-to-one association to SmartDatosMaestro
	@ManyToOne(optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name="sm_sctiposervicio",referencedColumnName = "sm_scdatosmaestros")
	private SmartDatosMaestro smartDatosMaestro;

	//bi-directional many-to-one association to SmartMedico
	@ManyToOne(optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name="sm_scmedico", referencedColumnName = "sm_scmedico")
	private SmartMedico smartMedico;

	//bi-directional many-to-one association to SmartCita
	@OneToMany(cascade = CascadeType.ALL, mappedBy="smartAgenda", fetch = FetchType.LAZY)
	private List<SmartCita> smartCitas;

	public SmartAgenda() {
	}

	public BigDecimal getSmScagenda() {
		return this.smScagenda;
	}

	public void setSmScagenda(BigDecimal smScagenda) {
		this.smScagenda = smScagenda;
	}

	public String getSmCoagenda() {
		return this.smCoagenda;
	}

	public void setSmCoagenda(String smCoagenda) {
		this.smCoagenda = smCoagenda;
	}

	public String getSmCousuario() {
		return this.smCousuario;
	}

	public void setSmCousuario(String smCousuario) {
		this.smCousuario = smCousuario;
	}

	public String getSmDsagenda() {
		return this.smDsagenda;
	}

	public void setSmDsagenda(String smDsagenda) {
		this.smDsagenda = smDsagenda;
	}

	public Date getSmFhagenda() {
		return this.smFhagenda;
	}

	public void setSmFhagenda(Date smFhagenda) {
		this.smFhagenda = smFhagenda;
	}

	public Date getSmFhhorafinal() {
		return this.smFhhorafinal;
	}

	public void setSmFhhorafinal(Date smFhhorafinal) {
		this.smFhhorafinal = smFhhorafinal;
	}

	public Date getSmFhhorainicio() {
		return this.smFhhorainicio;
	}

	public void setSmFhhorainicio(Date smFhhorainicio) {
		this.smFhhorainicio = smFhhorainicio;
	}

	public Date getSmFhingreso() {
		return this.smFhingreso;
	}

	public void setSmFhingreso(Date smFhingreso) {
		this.smFhingreso = smFhingreso;
	}

	public Date getSmFhmodificacion() {
		return this.smFhmodificacion;
	}

	public void setSmFhmodificacion(Date smFhmodificacion) {
		this.smFhmodificacion = smFhmodificacion;
	}

	public Date getSmFhretiro() {
		return this.smFhretiro;
	}

	public void setSmFhretiro(Date smFhretiro) {
		this.smFhretiro = smFhretiro;
	}

	public BigDecimal getSmScestado() {
		return this.smScestado;
	}

	public void setSmScestado(BigDecimal smScestado) {
		this.smScestado = smScestado;
	}

	public BigDecimal getSmScsede() {
		return this.smScsede;
	}

	public void setSmScsede(BigDecimal smScsede) {
		this.smScsede = smScsede;
	}

	public BigDecimal getSmSctiposervicios() {
		return this.smSctiposervicios;
	}

	public void setSmSctiposervicios(BigDecimal smSctiposervicios) {
		this.smSctiposervicios = smSctiposervicios;
	}

	public SmartConsultorio getSmartConsultorio() {
		return this.smartConsultorio;
	}

	public void setSmartConsultorio(SmartConsultorio smartConsultorio) {
		this.smartConsultorio = smartConsultorio;
	}

	public SmartSede getSmartSede() {
		return this.smartSede;
	}

	public void setSmartSede(SmartSede smartSede) {
		this.smartSede = smartSede;
	}

	public SmartDatosMaestro getSmartDatosMaestro() {
		return this.smartDatosMaestro;
	}

	public void setSmartDatosMaestro(SmartDatosMaestro smartDatosMaestro) {
		this.smartDatosMaestro = smartDatosMaestro;
	}

	public SmartMedico getSmartMedico() {
		return this.smartMedico;
	}

	public void setSmartMedico(SmartMedico smartMedico) {
		this.smartMedico = smartMedico;
	}

	public List<SmartCita> getSmartCitas() {
		return this.smartCitas;
	}

	public void setSmartCitas(List<SmartCita> smartCitas) {
		this.smartCitas = smartCitas;
	}

	public SmartCita addSmartCita(SmartCita smartCita) {
		getSmartCitas().add(smartCita);
		smartCita.setSmartAgenda(this);

		return smartCita;
	}

	public SmartCita removeSmartCita(SmartCita smartCita) {
		getSmartCitas().remove(smartCita);
		smartCita.setSmartAgenda(null);

		return smartCita;
	}

}